/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.sistemas.sse.entity;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Proxy;

/**
 *
 * @author laptop-w8
 */
@Entity
@Table(name = "MFAC")
@Proxy(lazy = false)
public class Facultad implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "mfac_seq_gen")
    @SequenceGenerator(name = "mfac_seq_gen", sequenceName = "MFAC_SEQ")
    @Column(name = "CFAC")
    private long id_facultad;
    @Column(name = "DNM_FAC")
    private String dnombre;
    @Column(name = "DAREA_FAC")
    private String darea;
    @OneToOne(cascade = {CascadeType.ALL}, mappedBy = "facultad")
    @JoinColumn(name = "CADMIN_DNI")
    private Administrador administrador;
    @OneToOne(cascade = {CascadeType.ALL}, mappedBy = "facultad")
    @JoinColumn(name = "CJOCAA_DNI")
    private JefeOcaa jefeOcaa;
    @OneToOne(cascade = {CascadeType.ALL}, mappedBy = "facultad")
    @JoinColumn(name = "CJUB_DNI")
    private JefeUBienestar jefeUbienestar;
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "facultad")
    private Set<Eap> eaps;

    public String toString() {
        return "Facultad [id=" + id_facultad + ";nombre=" + dnombre + ";area=" + darea + "]";
    }

    public long getId_facultad() {
        return id_facultad;
    }

    public void setId_facultad(long id_facultad) {
        this.id_facultad = id_facultad;
    }

    public String getDnombre() {
        return dnombre;
    }

    public void setDnombre(String dnombre) {
        this.dnombre = dnombre;
    }

    public String getDarea() {
        return darea;
    }

    public void setDarea(String darea) {
        this.darea = darea;
    }

    public Administrador getAdministrador() {
        return administrador;
    }

    public void setAdministrador(Administrador administrador) {
        this.administrador = administrador;
    }

    public JefeOcaa getJefeOcaa() {
        return jefeOcaa;
    }

    public void setJefeOcaa(JefeOcaa jefeOcaa) {
        this.jefeOcaa = jefeOcaa;
    }

    public JefeUBienestar getJefeUbienestar() {
        return jefeUbienestar;
    }

    public void setJefeUbienestar(JefeUBienestar jefeUbienestar) {
        this.jefeUbienestar = jefeUbienestar;
    }

    public Set<Eap> getEaps() {
        return eaps;
    }

    public void setEaps(Set<Eap> eaps) {
        this.eaps = eaps;
    }

}
